package com.qf.mq;

import com.qf.service.PushToClient;
import com.qianfeng.smsplatform.common.constants.RabbitMqConsants;
import com.qianfeng.smsplatform.common.model.Standard_Report;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author 徐老板
 * @date 2020/3/4   11:37
 */
@Component
public class ReceiveFromStrategy {
    @Resource
    private PushToClient statusReportService;

    @RabbitListener(queues = RabbitMqConsants.TOPIC_PUSH_SMS_REPORT,containerFactory = "taskContainerFactory")
    public void onMessage(Standard_Report report){
        //这里收到报告然后调用方法转发给客户就行 所有这里要写一个方法 基于可插拔的思想 这里写一个接口
        statusReportService.sendReport(report);
    }

}
